<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8"/>
    <title>Title</title>
</head>
<script src="https://libs.baidu.com/jquery/1.9.1/jquery.min.js"></script>
<body>
    <div style="margin-left: 100px ;margin-top: 30px">
        <p>Login User.Welcome to the Fruits storefront.</p>
        <p><a id="link-to-another-sys" href="https://www.luolineya.xyz/car/secure/product/list">Go to view some cars reseller's products.</a></p>
<!--        <p><a href="http://localhost:8180/car/secure/product/list">Go to view some cars reseller's products.</a></p>-->
        <p>
            <a href="https://www.luolineya.xyz/storefront/secure/account/logout">Logout.</a>
        </p>
        <p>
            <table width="300px" border="1">
                <thead>
                    <tr>
                        <td width="20%">#</td>
                        <td width="50%">Product Name</td>
                        <td width="30">Price</td>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td>1</td>
                        <td>Apple</td>
                        <td>$1.7</td>
                    </tr>
                    <tr>
                        <td>2</td>
                        <td>Banana</td>
                        <td>$1.2</td>
                    </tr>
                    <tr>
                        <td>3</td>
                        <td>Orange</td>
                        <td>$0.8</td>
                    </tr>
                </tbody>
            </table>
        </p>
    </div>
    <script>
        $(document).ready(function(){
            $.ajax({
                url:'/storefront/token/getAccessToken',
                type:'get',
                //dataType:'string',
                contentType:'text/plain',
                success:function(res){
                    // console.log(res);
                    var a = $('#link-to-another-sys')
                    var href = a.attr('href');
                    // console.log(href);
                    a.attr('href',href+'?access_token='+res);
                },
                error:function(res){
                    console.log(res);
                }
            });
        });
    </script>
</body>
</html>